package cn.demo.service1;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.sleuth.Sampler;
import org.springframework.cloud.sleuth.sampler.AlwaysSampler;
import org.springframework.context.annotation.Bean;

/**
 * @Author: liujiahao
 * @Description:
 */
@SpringBootApplication
public class ApplicationZipKin {

    public static void main(String[] args) {
        SpringApplication.run(ApplicationZipKin.class, args);
    }


    /**
     * 所有事物都会被zipkin跟踪
     * 也可配置 spring.sleuth.sampler.percentage=1  范围(0-1)
     * @return
     */
    @Bean
    public Sampler defaultSampler() {
        return new AlwaysSampler();
    }

}
